home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
telecomm
/
fnorddel
/
fn132man.zoo
/
chapter.06
< prev
next >
Wrap
Text File
|
1991-09-02
|
15KB
|
397 lines
Chapter 6: Modem Stuff 86
6 Modem Stuff
Modems are finicky beasts, and cajoling them into talking to your
Fnordadel properly can be a tricky piece of business. This chapter, then,
deals with the various modem configuration options in Fnordadel, and gives
some tips on how to make a recalcitrant modem behave.
6.1 Basic Modem Requirements
To run a Fnordadel, you must have a modem possessing a modicum of basic
features. These are:
o Must be able to auto-answer the phone.
o Must be able to respond to DTR (Data Terminal Ready) line control by
the computer. DTR is supposed to be pin 20 on the RS-232 connector.
Ideally, the modem should be able to hang up the phone, disable auto
answer, and go to `command' mode when the computer flips DTR off (and
reverse the above when DTR goes high).
o Must have the CD (Carrier Detect) line tracking the status of the
carrier. CD (or DCD) is supposed to be pin 8 on the RS-232 connector.
o If you want to do any calling out (i.e., during networking or
whatever), the modem must be able to autodial the phone using a command
string.
Most modems are perfectly capable of all of the above. If your modem is
advertised as being ``Hayes-compatible'', then it *should* work fine. The
DTR and CD settings will likely have to be adjusted, since most modems do
not by default listen to DTR and most leave the CD line high all the time.
These behaviours can be changed either by using a DIP-switch or in the
software; it's almost always possible.
STadel 3.3b, from which Fnordadel is descended, was advertised to work
with the following list of modems, and there's no reason to believe that
we've introduced any incompatibilities:
o Avatex 1200, 1200E, 1200HC, 2400HC
o Everex 2400
o FastComm 19200
o Hayes 1200, 2400
o Incomm 2400
o MultiTech 1200, 2400
o Prometheus 2400B2
o Supra 2400
Chapter 6: Modem Stuff 87
o Telebit Trailblazer 19,200
o USR Courier 2400, HST 9600
The Fnordadel developers both use the Supra 2400; we've been running 24
hours a day for a few years now and have had no problems with the wee
beasties. Your mileage may vary, of course.
6.2 Setting Up the Modem
If your modem meets the above criteria, then we're off. (If it doesn't,
then go buy a real modem---1200 and 2400 baud Hayes compatible modems
are dirt cheap these days.) In this section we'll describe some of the
`ctdlcnfg.sys' options for the modem.
6.2.1 Baud rate
You must tell Fnordadel the highest baud rate at which the modem
will function; this is accomplished by setting the variable #sysbaud in
`ctdlcnfg.sys'. #sysbaud can have any one of the following values:
0 300 bps only
1 300 and 1200 bps
2 300, 1200 and 2400 bps
3 300, 1200, 2400 and 9600 bps
4 300 up to 19200 bps
Note that 4800 bps is not supported. The ST serial port will do 4800,
but we've never heard of a modem that will, other than ones that will also
go faster. If for some reason you find yourself in dire need of 4800, see
Appendix A [Fnordadel Support], page 170.
6.2.2 Initialisation
Hayes compatible modems, at least, understand a set of commands to
control their behaviour. Fnordadel requires that the modem be set up in a
certain way; thus, you must define a command string which will be sent to
the modem every time Fnordadel wants to reset the modem. Simply put a line
like the following:
#modemsetup "AT &C1 &D2 V0 E0 M0 Q0 X4 S0=1\r%10"
in your `ctdlcnfg.sys'. The example above will work on many
Hayes-compatible modems. The various parts mean:
o The initial `AT' tells the modem that a command string is coming.
Chapter 6: Modem Stuff 88
o `&C1 &D2' sets up the required behaviour for the CD and DTR lines
(see Section 6.1 [Basic Modem Requirements], page 86). If your modem
controls CD and DTR with hardware switches, it probably will not
support these commands, so you may have to remove them.
o `V0 E0 M0 Q0' selects numeric result codes (see Section 6.2.3.2 [Result
codes], page 89), turns off command echoing, turns off the built-in
speaker, and turns on result codes.
o `X4' tells the modem to return the full range of result codes (see
Section 6.2.3.2 [Result codes], page 89).
o `S0=1' tells the modem to answer the phone on the first ring.
o `\r' represents a carriage return, which must be there to terminate the
command string.
o And finally, `%10' is a special notation which causes Fnordadel to
pause for 10 tenths of a second (i.e., one second). This is necessary
for some modems, which take a comparatively long time to process the
command string. (See the front of `ctdlcnfg.doc' for more on the
format of these sorts of string variables.)
Please be warned that your modem may not recognise some or all of the
above codes; they may be different, or absent, or whatever. We've seen
some pretty mental modem behaviour, so be sure to read your modem manual.
A trick which has proved useful with many modems is as follows: If the
modem allows you to save its settings in non-volatile RAM (i.e., if the
settings can be preserved when the modem is powered off), then you can
use a terminal program of some kind to manually set up the modem the way
Fnordadel wants it, by sending your version of the above command string
to the modem. Then use the command to save settings (usually `AT&W' or
something). At this point you can simply use `ATZ\r%10' as the #modemsetup
string; `ATZ' has the effect of resetting the modem to the saved state.
The advantage of this is that the string is shorter, so it can speed things
up a bit, especially during networking or auto-dialing when the modem is
being reset many times.
6.2.3 Baud-rate detection
Fnordadel must be able to detect the baud rate of incoming calls, and
it has a couple of ways to accomplish this. The first is by searchbaud,
and the second is using result codes. Result codes are by far the better
method, and since most modems can support the feature, we recommend it.
Chapter 6: Modem Stuff 89
6.2.3.1 Searchbaud
If you define the `ctdlcnfg.sys' variable #searchbaud to be `1', it
will cause Fnordadel to loop through the range of supported baud rates
(as defined by #sysbaud; see Section 6.2.1 [Baud rate], page 87), waiting
one-half second at each rate for a carriage return (`<CR>') from the
caller. The upshot of this is that callers must hit `<CR>' once or twice
when they connect with the BBS.
If #searchbaud is `0', then your BBS will work at *only* the highest
baud rate represented by #sysbaud. This is last-resort stuff, kids.
You should normally run with #searchbaud set to `1' unless your modem
absolutely fails to properly detect other speed connections. (If your
modem is this stupid, it might be time to consider getting another one.)
The variable #connectprompt modifies the behaviour of #searchbaud
slightly; if defined to be `1', it causes Fnordadel to loop through the
baud rates, spitting out a prompt which says ``Type return'' and waiting
for a `<CR>' for a while; it does all this until the user hits `<CR>' at
some baud rate, or until it gives up.
Anyway, this is all pretty ugly, really; a far better method is to use
result codes.
6.2.3.2 Result codes
Most modems, Hayes-compatible ones included, will send a code to the
computer when they pick up a carrier; furthermore, they can usually be
configured to return a different code depending on the speed of the
connection. We utilise this to our advantage.